﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr" lang="en">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Content-Language" content="en" />
        <meta name="keywords" content="sparql grammar parser antlr" />
        <link rel="shortcut icon" href="favicon.ico" />
        <link rel="license" href="" />
        <link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
        <title>RDFCoder - Architecture</title>
    </head>

    <body>
        <div id="container">
            <div id="header">
                <h1>RDFCoder - Architecture</h1>
            </div>

            <div id="page">
                <!-- START SIDEBAR -->
                <div id="sidebar">
                    <div id="sidebarslidebox">
                        <div>
                            <div class="related">
                                <div>
									<h3>Navigation<h3/>
									<ul>
										<li><a href="index.html">Home</a></li>
									</ul>
                                    <h3>Architecture</h3>
                                    <ul>
										<li><a href="#overall_architecture">Overall Architecture</a></li>
										<li><a href="#objects_table">Objects Table</a></li>
                                        <li><a href="#java_source_parser">Java Source Parser</a></li>
                                        <li><a href="#javadoc_parser">Javadoc Parser</a></li>
										<li><a href="#java_bytecode_file_parser">Java Bytecode File Parser</a></li>
										<li><a href="#java_bytecode_jar_parser">Java Bytecode JAR Parser</a></li>
										<li><a href="#directory_parser">Directory Parser</a></li>
										
										<li><a href="#code_handler">Code Handler</a></li>
										<li><a href="#code_model">Code Model</a></li>
										<li><a href="#query_model">Query Model</a></li>
										
										<li><a href="#code_storage">Code Storage</a></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- END SIDEBAR -->

                <div id="content">
                    <div class="article">
                        <h1 class="firstHeading">Architecture</h1>

                        <a name="overall_architecture"></a>
                        <h2>Overall Architecture</h2>
                        <p>
							The figure below shows the <b>RDF Coder</b> overall architecture.
							The main elements of architecture are:
							<ul>
								<li>
									<b>Java Source Parser</b> - a set of classes able to parse <b>.java</b> files and convert its contents
									in <b>CodeHandler</b> events.
								</li>
								<li>
									<b>Java Bytecode Parser</b> - a set of classes able to parse <b>.class</b> files (eventually inside <b>.jar</b> archives) and convert its contents
									in <b>Code Handler</b> events.
								</li>
								<li>
									<b>Javadoc Parser</b> - a set of classes able to parse <b>.java</b> files <b>Javadoc</b> documentation and convert it
									in <b>Code Handler</b> events.
								</li>
								<li>
									<b>Code Handler</b> - the Code Handler is a class able to convert class events in RDF triples. <br/>
									The way the Code handler translates received events into triples is described in <a href="model.html">model</a> section.
									Despite the Code Handler currently generates only RDF triples, in theory may generate any entity representation
									compliant with the interface of the <b>Code Model</b>. 
								</li>
								<li>
									<b>Objects Table</b> - the Code Handler needs to fully qualify (i.e.: add full package qualification) all the objects it finds 
									during the compilation process. 
									<br/>
									The fully qualification is done by populating and querying the Objects Table. Every time that an Object needs 
									to be fully qualified, the Objects Table is inquired by providing the object name and the <b>Imports Context</b>
									that is the list of the imports provided when used the object itself.
								</li>
								<li>
									<b>Code Model</b> - the Code Model is a container of the triples representing a bunch of related libraries. 
									<br/>
									A code model provides operations to add triples, remove triples, perform basic search on triples, perform complex queries. 
									<br/>
									Despite currently the only implementation provided is an RDF model, the Code Model may rely on any support able to 
									store relationships among the entities involved in the code representation. 
								</li>
								<li>
									<b>Code Storage</b> - the Code Storage is a set of classes meant to make <b>persistent</b> a code model.
									<br/>
									There may be several persistent storages like Filesystem or a <b>RDMS</b>.
								</li>
								<li>
									<b>Query Engine</b> - the Query Engine is a set of classes meant to perform queries on a storage.
									<br/>
									At the moment the only supported query language is <a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</a>.
								</li>
								<li>
									<b>Model Inspector</b> - the Model Inspector is a high level representation of the Code Model.
									<br/>
									By using the Model Inspector it is possible to navigate Java objects representing the entities stored
									into the model.
								</li>
							</ul>
							<br/>
							<font color="red">TODO</font>	
						</p>

                        <p><img src="images/rdf_coder_architecture.jpg"></p>
                    </div>

                    <div class="article">
                        <h1 class="firstHeading">Parsing</h1>
						
						<a name="objects_table"></a>
						<h2>Objects Table</h2>
						<div>
							This class defines a table to resolve objects.
							<br/>
							<a href="../../javadoc/com/asemantics/sourceparse/ObjectsTable.html">reference</a>
						</div>

                        <a name="java_source_parser"></a>
                        <h2>JavaSourceFileParser</h2>
						<div>
							This class is able to scan a java source file and generate corresponding triples.
							<br/>
							<a href="../../javadoc/com/asemantics/sourceparse/JavaSourceFileParser.html">reference</a>
						</div>
						
						 <a name="javadoc_parser"></a>
	                     <h2>JavadocFileParser</h2>
						<div>
							The Javadoc file parser.
							<br/>
							<a href="../../javadoc/com/asemantics/sourceparse/JavadocFileParser.html">reference</a>
						</div>

                        <a name="java_bytecode_file_parser"></a>
                        <h2>JavaBytecodeFileParser</h2>
						<div>
							The Java bytecode parser.
							<br/>
							<a href="../../javadoc/com/asemantics/sourceparse/JavaBytecodeFileParser.html">reference</a>
						</div>
						
						<a name="java_bytecode_jar_parser"></a>
						<h2>JavaBytecodeJarParser</h2>
						<div>
							This class provides methods to process the content of a Jar file.
							<br/>
							<a href="../../javadoc/com/asemantics/sourceparse/JavaBytecodeJarParser.html">reference</a>
						</div>
						
						<a name="directory_parser"></a>
						<h2>DirectoryParser</h2>
						<div>
							Scans a given directory.
							<br/>
							<a href="../../javadoc/com/asemantics/sourceparse/DirectoryParser.html">reference</a>
						</div>
						
                    </div>

                    <div class="article">
                        <h1 class="firstHeading">Modeling</h1>
                        
						<a name="code_handler"></a>
						<h2>Code Handler</h2>
						<div>
							This interface represents a code handler. 
							An handler is something able to receive code analysis events and use it to perform some analysis.
							<br/>
							<a href="../../javadoc/com/asemantics/model/CodeHandler.html">reference</a>
						</div>
						
						<a name="code_model"></a>
						<h2>Code Model</h2>
						<div>
							This abstract class describes a code org.asemantics.model. 
							A code org.asemantics.model is a rapresentation of a code structure 
							containing packages, classes, attributes methods and so on.
							<br/>
							<a href="../../javadoc/com/asemantics/model/CodeModel.html">reference</a>
						</div>
						
						<a name="query_model"></a>
						<h2>Query Model</h2>
						<div>
							Common interface to perform queries on representational model.
							<br/>
							<a href="../../javadoc/com/asemantics/model/QueryModel.html">reference</a>
						</div>

                    </div>

                    <div class="article">
                        <h1 class="firstHeading">Storing</h1>

						<a name="code_storage"></a>
						<h2>Code Storage</h2>
						<div>
							Defines a persistent sotrage for a CodeModel.
							<br/>
							<a href="../../javadoc/com/asemantics/storage/CodeStorage.html">reference</a>
						</div>

					</div>

          

                <!-- end id content -->

                <div id="footer">
                    <ul>
                        <li>Copyright &copy; 2007 - The <a href="http://code.google.com/p/rdf-coder/">RDF Coder</a> team</li>
                    </ul>
                    <ul>
                        <li>Content is available under <a href="http://path/to/apache/license">Apache License</a> [the Apache License].</li>
                    </ul>
                </div>

            </div>
            <!-- end id page -->

        </div>
        <!-- end id container -->
    </body>

</html>
